import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
	{
		path: '/',
		redirect: 'recommend'
	},
  {
    path: '/home',
    name: 'home',
    component: Home,
	children:[
		{
			path: '/mine',
			name: 'mine',
			component: () => import('../views/mine.vue')
		},
		{
			path: '/recommend',
			name: 'recommend',
			component: () => import('../views/recommend.vue')
		},
		{
			path: '/hotsong',
			name: 'hotsong',
			component: () => import('../views/hotsong.vue')
		},
		{
		  path: '/search',
		  name: 'search',
		  component: () => import('../views/search.vue')
		}
	]
  },
  {
    path: '/list/:songid',
    name: 'list',
    component: () => import('../views/List.vue')
  },
]

const router = new VueRouter({
  routes
})

export default router
